import coffee.American;
import coffee.ShortBlack;
import decorator.Chocolate;
import decorator.Decorator;
import decorator.Milk;
import drink.Drink;

public class Client {
    public static void main(String[] args) {
        //Drink drink = new ShortBlack();
        Drink drink = new American();
        System.out.print(drink.getDesr());
        System.out.println(" 总价"+drink.cost());

        drink = new Milk(drink);
        drink = new Chocolate(drink);
        System.out.print(drink.getDesr());
        System.out.println(" 总价"+drink.cost());
        System.out.println(((Decorator)drink).getDrink().getDesr());


        drink = new Chocolate(drink);
        System.out.print(drink.getDesr());
        System.out.println(" 总价"+drink.cost());

        System.out.println(
                ((Decorator)(((Decorator)drink).getDrink())).getDrink().getPrice()
        );

    }
}
